<?php
	include "sql.php";
	if(is_array($_POST)&&count($_POST)==2){
		$parkingName = $heart = "";
		if($_SERVER["REQUEST_METHOD"] == "POST"){
			$parkingName = $_POST["parkingName"];
			$heart = $_POST["heart"];
			if($parkingName!=null && $parkingName!="" && $heart!=""){
				$res = setHeart($parkingName,$heart);
				$table = $sql = "";
				$index = 0;
				$str = "";
				foreach ($res as $row) {
					foreach ($row as $key => $value){
						if(preg_match("/^\d*$/",$key)) continue;
						if($index%2==0){
							if($table=="") $table = $value;
							else $table = "$table#$value";
						}
						else{
							if($sql=="") $sql = $value;
							else $sql = "$sql#$value";
						} 
						$index++;
					}
				}
				echo "$table##$sql";
			}
		}
	}
?>